import $ from "jquery";
function apiRequest(url,type,options,success,error){
  if (typeof options == 'function') {
    error=success
    success=options
    options={}
  }
  $.ajax({
    url:url,
    type:type,
    data:options,
    success:function(data){
      if (data.status) {
        success(data)
      }else{
        error!==undefined&&error(data);
      }
    },
    error:function(err){
      console.log(err)
    }
  })
}
let domain = "https://topart.cn"
const functions = {
  getUserInfo(options,success,error){
    let  url= domain + '/MinProgram2/User/queryUserInfo'
    apiRequest(url,'post',options,success,error)
  }
}
export default {
  functions
}
